<template>
    <div>
        <el-dialog :title="title" :visible.sync="dialogFormVisible" @close="closeDialogFormVisible">
            <el-form :model="form" label-width="70px">
                <el-form-item label="类别名称">
                    <el-input v-model="form.name" ></el-input>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="closeDialogFormVisible">取 消</el-button>
                <el-button :loading="loading" type="primary" @click="submitDialogForm">确 定</el-button>
            </div>
        </el-dialog>
    </div>
</template>

<script>
export default {
    name: 'DialogCategoryComponent',
    components: {
    },
    props: {
        dialogFormVisible: {
            type: Boolean,
            default: false,
        },
        form: {
            type: Object,
            default: () => { }
        },
        title: {
            type: String,
            default: '类别弹框'
        },
        loading: {
            type: Boolean,
            default: false
        }
    },
    data() {
        return {
            // loading: false,
        }
    },
    mounted() {
    },
    methods: {
        closeDialogFormVisible() {
            
            this.$emit('closeDialogForm');
            this.form = {};
        },
        submitDialogForm() {
            
            this.$emit('submitDialogForm', this.form);
            this.form = {};
        }

    },

}
</script>

<style lang="scss" scoped></style>